<template>
  <vxe-select v-model="myValue" multiple v-bind="$attrs" v-on="$listeners" @change="change">
  </vxe-select>
</template>

<script>

export default {
  name: 'YchVxeMultipleSelect',
  props: {
    value: String
  },
  data() {
    return {
      myValue: null
    }
  },
  methods: {
    change({value}) {
      let newValue = value ? value.join(",") : null
      this.$emit('input', newValue)
    }
  },
  watch: {
    value: {
      handler(value) {
        this.myValue = value ? value.split(",") : null
      },
      immediate: true
    }
  },
  model: {
    prop: 'value',
    event: 'input'
  }
}

</script>
